package com.zz.inventory.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zz.inventory.mapper.FranchisePackagesMapper;
import com.zz.inventory.domain.FranchisePackages;
import com.zz.inventory.service.IFranchisePackagesService;

/**
 * 套餐配置管理Service业务层处理
 * 
 * @author zz
 * @date 2025-07-03
 */
@Service
public class FranchisePackagesServiceImpl implements IFranchisePackagesService 
{
    @Autowired
    private FranchisePackagesMapper franchisePackagesMapper;

    /**
     * 查询套餐配置管理
     * 
     * @param packageId 套餐配置管理主键
     * @return 套餐配置管理
     */
    @Override
    public FranchisePackages selectFranchisePackagesByPackageId(Long packageId)
    {
        return franchisePackagesMapper.selectFranchisePackagesByPackageId(packageId);
    }

    /**
     * 查询套餐配置管理列表
     * 
     * @param franchisePackages 套餐配置管理
     * @return 套餐配置管理
     */
    @Override
    public List<FranchisePackages> selectFranchisePackagesList(FranchisePackages franchisePackages)
    {
        return franchisePackagesMapper.selectFranchisePackagesList(franchisePackages);
    }

    /**
     * 新增套餐配置管理
     * 
     * @param franchisePackages 套餐配置管理
     * @return 结果
     */
    @Override
    public int insertFranchisePackages(FranchisePackages franchisePackages)
    {
        franchisePackages.setCreateTime(DateUtils.getNowDate());
        return franchisePackagesMapper.insertFranchisePackages(franchisePackages);
    }

    /**
     * 修改套餐配置管理
     * 
     * @param franchisePackages 套餐配置管理
     * @return 结果
     */
    @Override
    public int updateFranchisePackages(FranchisePackages franchisePackages)
    {
        franchisePackages.setUpdateTime(DateUtils.getNowDate());
        return franchisePackagesMapper.updateFranchisePackages(franchisePackages);
    }

    /**
     * 批量删除套餐配置管理
     * 
     * @param packageIds 需要删除的套餐配置管理主键
     * @return 结果
     */
    @Override
    public int deleteFranchisePackagesByPackageIds(Long[] packageIds)
    {
        return franchisePackagesMapper.deleteFranchisePackagesByPackageIds(packageIds);
    }

    /**
     * 删除套餐配置管理信息
     * 
     * @param packageId 套餐配置管理主键
     * @return 结果
     */
    @Override
    public int deleteFranchisePackagesByPackageId(Long packageId)
    {
        return franchisePackagesMapper.deleteFranchisePackagesByPackageId(packageId);
    }
}
